package com.union.vehicleassistant.adapter;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.union.vehicleassistant.R;
import com.union.vehicleassistant.bean.ChannelBean;

import java.util.List;

public class ModeAdapter extends BaseQuickAdapter<ChannelBean, BaseViewHolder> {

    public ModeAdapter(@Nullable List<ChannelBean> data) {
        super(R.layout.item_mode_option, data);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder baseViewHolder, ChannelBean channelBean) {
        int position = getItemPosition(channelBean);
        baseViewHolder.setText(R.id.tv_option, getContext().getString(R.string.setting_mode) + "\t" + parseRomaNum(position));
    }

    public static String parseRomaNum(int pos) {
        String[] arr = {"Ⅰ", "Ⅱ", "Ⅲ", "Ⅳ", "Ⅴ", "Ⅵ", "Ⅶ", "Ⅷ", "Ⅸ"};
        return arr[pos];
    }
}
